package cn.itcast.cd.service.impl;

import java.util.List;

import cn.itcast.cd.dao.IBaseDao;
import cn.itcast.cd.dao.IProductDao;
import cn.itcast.cd.domain.Product;
import cn.itcast.cd.query.IQuery;
import cn.itcast.cd.resultPage.ResultPage;
import cn.itcast.cd.service.IProductService;
import cn.itcast.cd.utils.MD5;

public class ProductServiceImpl implements IProductService {

	private IProductDao ProductDao;
	
	public void setProductDao(IProductDao ProductDao) {
		this.ProductDao = ProductDao;
	}

	@Override
	public void save(Product Product) {
		ProductDao.save(Product);
	}

	@Override
	public Product get(Long id) {
		return (Product) ProductDao.get(id);
	}

	@Override
	public ResultPage query(String hql, Object[] params, int start, int limit) {
		return ProductDao.query(hql, params, start, limit);
	}

	@Override
	public void delete(Long id) {
		ProductDao.delete(id);
	}

	@Override
	public void update(Product Product) {
		ProductDao.update(Product);
	}

	@Override
	public ResultPage queryEntity(IQuery query) {
		
		return ProductDao.queryEntity(query);
	}

	@Override
	public List<Product> queryEntity(String conditions, Object[] params) {
		
		return ProductDao.queryEntity(conditions, params);
	}

}
